$(document).ready(function () {
    var jtjsUrl = global.localhost+"Api/New/get_jtjs";
    sendAjax(jtjsUrl,function (res) {
        console.log(res);
        var html = res[0].content

        $(".alasun-intro-box").html(html)
    })
    var speechUrl = global.localhost+"Api/New/get_dszzc";
    sendAjax(speechUrl,function (res) {
        var html = res[0].content
        // $(".chairman-text").html(html);
        $('.ldzc').html(html);
    })
    var teamUrl = global.localhost+"Api/New/get_ldtd";
    sendAjax(teamUrl,function(res){
        console.log(res);
        var html = "";
        for(var i=0;i<res.length;i++){
            html += " <li>";
            html += " <a>";
            html += "<div class='ld-img' style='background: url("+res[i].title_img+") no-repeat center center /cover'></div>";
            html += "<div class='ld-intro'>";
            html += "<div class='ld-name'>"+res[i].title+"</div>";
            html += "<div class='ld-desc'>"+res[i].content+"</div>";
            html += "</div>";
            html += "</a>";
            html += "</li>";
        }
        $(".ldtd ul").html(html);
    })
    var cultureUrl = global.localhost+"Api/New/get_qywh";
    sendAjax(cultureUrl,function(res){
        console.log(res);
        var html = "";
        for(var i=0;i<res.length;i++){
            // html += "<li><span>"+res[i].title+"</span>"+res[i].content+"</li>";
            html += '<li>';
            html += '<div class="qywh-key">'+res[i].title+'</div>';
            html += '<div class="qywh-text">';
            html += '<p class="qywh-cn">'+res[i].content+'</p>';
            html += '<p class="qywh-en">'+res[i].english+'</p>';
            html += '</div>';
            html += '</li>';
        }
        $(".qywh-list").html(html);
    })
    var honorUrl = global.localhost+"Api/New/get_jtry";
    sendAjax(honorUrl,function (res) {
        console.log(res);
        var html = '';
        for(var i=0;i<res.smeta.length;i++){
            html += '<li style="background:url(\''+res.smeta[i].url+'\') center center/cover no-repeat">';
            html += '<p class="honor-desc">'+res.smeta[i].alt+'</p>';
            html += '</li>'
        }

         //$(".qyry-list").html(html);
    })
    var param = getSearch();
    var item = param[0].split('=')[1];
    if(item == 0){
        $('.alasun-title').text('阿拉膳健康科技集团');
    }else if(item == 1){
        $('.alasun-title').text('我们的健康中国梦');
    }else if(item == 2){
        $('.alasun-title').text('领导团队');
    }else if(item == 3){
        $('.alasun-title').text('核心价值观');
    }else if(item == 4){
        $('.alasun-title').text('资质荣誉');
    }
    $('.nav-list').on('click','li',function () {
        var index = $(this).index();
        if(index == 0){
            $('.alasun-title').text('阿拉膳健康科技集团');
        }else if(index == 1){
            $('.alasun-title').text('我们的健康中国梦');
        }else if(index == 2){
            $('.alasun-title').text('领导团队');
        }else if(index == 3){
            $('.alasun-title').text('核心价值观');
        }else if(index == 4){
            $('.alasun-title').text('资质荣誉');
        }
    })


})